JavaScript LAB

A Bed and Breakfast needs a web page to advertise to its customers.

Your job is to provide a Web page, with JavaScript, to calculate the charge for a given stay.

Your Web Page should have a FORM which asks:
Number of Adults:
Number of Nights:

Every visit has a one-time Cleaning Fee of $100.00.
A room costs $190.00 per NIGHT.
Breakfast is $10.00 per person per night.
State tax is 15.75% of the total charges.

Write a JavaScript function, perhaps called ‘myFunction’,  which:
Gets (number of) Adults and (number of Nights) from your form
Gets cleaning charge, room charge, breakfast charge, and tax rate, from the table.
Modifies the entries in the table so that the customer has a correct breakdown of their bill.

See JavaScript.rtf for helpful examples.
To look at or change entries in the table, use document.getElementById("A_NAME").innerHTML;
(see UP() DOWN() )
To get a value from a FORM use document.getElementById("FORM_NAME").value
(see convertCF)

(see next page)

My table looks like the following.
TotalTable, Clean, RoomCost, Nights, Adults, BreakfastCharge, TaxCharge should all be modified, as necessary.
(For example, RoomCost depends on Nights from your form, BreakfastCharge depends on Nights and Adults, TaxCharge is computed from the total of all (other) charges,but Clean is the same for every visit.)

<table style="width:100%">
  <tr>
    <td><p id = TotalTable>315.75</p></td>
    <td><p>Total Bed and Breakfast Charges</p></td>
  </tr>
  <tr>
    <td><p id = Clean>100.00</p></td>
    <td><p>Cleaning fee</p></td>
  </tr>
  <tr>
    <td><p id = RoomCost>190.00</p></td>
    <td><p id = RoomCostText>Room charge (per night)</p></td>
  </tr>
    <tr>
    <td><p id = Nights>1</p></td>
    <td><p>Number of nights</p></td>
  </tr>
    <tr>
    <td><p id = Adults>1</p></td>
    <td><p>Number of adults (per night)</p></td>
  </tr>
    <tr>
    <td><p id = BreakfastCharge>10</p></td>
    <td><p id = BreakfastChargeText>Charge for breakfast (per person per night)</p></td>
  </tr>
    <tr>
    <td><p id = TaxCharge>15.75</p></td>
    <td><p>Charge for taxes</p></td>
  </tr>
</table>

 Suggested breakdown:
Write a web page, with a FORM for Adults and Nights.
Write a JavaScript function to compute total charges.
Modify your program so that it gets Clean, RoomCost, BreakfastCharge, and TaxCharge from the table.
Then modify it so that puts the final total in TotalCharge, and correctly reports RoomCost, Nights, Adults, TaxCharge in the table.

ASK for help if you need it.